import request from "./request";
const api = {};
const url = {
	sendCode: "/api/sendVCode", //获取手机验证码
	getAesKey: "/getAesKey",
	getOpenId: "/api/getOpenId", //通过code获取openId
	checkUser: "/api/checkUser", //校验用户
	addUser: "/api/addUser", //新增用户
	findStuList: "/api/student/findStuList", //学生列表
	addStudent: "/api/student/add", //新增学生
	updateStudent: "/api/student/update", //修改学生
	addPersonJobHunt: "/httpinterface/addJobHunt", //新增个人求职
	addRecruit: "/httpinterface/addRecruit",//新增企业招聘
	findIndustryList: "/admin/industry/findAll",//获取行业类型list
	findPostionList: "/admin/position/findAll",//获取招聘职位list
	findRecruitInfoByOpenId: "/httpinterface/findRecruitInfoByOpenId",//根据OpenID获取招聘信息(全职)
	addOdd: "/admin/zero/add",//新增零工市场招聘
	findRecOddJobByOpenId: "/httpinterface/findRecOddJobByOpenId",//根据OpenID获取零工招聘
	recruitUpdate: "/httpinterface/editRecruitInfoById",//更改全职信息
	zeroUpdate: "/httpinterface/editRecOddJobById",//更改零工信息
	removeImage: "/admin/resource/delete",
	findAllRecruitJobPosition: "/httpinterface/findAllRecruitJobPosition",//H5-查询所有企业招聘岗位信息(全职)
	findAllOddJobPosition: "/httpinterface/findAllOddJobPosition",//H5-查询所有企业招聘岗位信息(零工)
	smsCode:"/send/smscode",
	login:"/login"
};

api.addPersonJobHunt = (params) => {
	return request.globalRequest(
		url.addPersonJobHunt,
		"POST",
		params
	);
};

api.addRecruit = (params) => {
	return request.globalRequest(
		url.addRecruit,
		"POST",
		params
	);
};

api.addOdd = (params) => {
	return request.globalRequest(
		url.addOdd,
		"POST",
		params
	);
};

api.findIndustryList = (params) => {
	return request.globalRequest(
		url.findIndustryList,
		"GET",
		params
	);
};

api.findPostionList = (params) => {
	return request.globalRequest(
		url.findPostionList,
		"GET",
		params
	);
};

api.findRecruitInfoByOpenId = (params) => {
	return request.globalRequest(
		url.findRecruitInfoByOpenId,
		"POST",
		params
	);
};

api.findRecOddJobByOpenId = (params) => {
	return request.globalRequest(
		url.findRecOddJobByOpenId,
		"POST",
		params
	);
};

api.findAllRecruitJobPosition = (params) => {
	return request.globalRequest(
		url.findAllRecruitJobPosition,
		"POST",
		params
	);
};

api.findAllOddJobPosition = (params) => {
	return request.globalRequest(
		url.findAllOddJobPosition,
		"POST",
		params
	);
};


api.recruitUpdate = (params) => {
	return request.globalRequest(
		url.recruitUpdate,
		"POST",
		params
	);
};

api.zeroUpdate = (params) => {
	return request.globalRequest(
		url.zeroUpdate,
		"POST",
		params
	);
};

api.removeImage = (params) => {
	return request.globalRequest(
		url.removeImage,
		"POST",
		params
	);
};

api.sendCode = (params) => {
	return request.globalRequest(
		url.sendCode,
		"POST",
		params
		// qs.stringify(params)
	);
};
api.postPublicKey = (params) => {
	return request.globalRequest(
		url.getAesKey,
		"POST",
		params
		// qs.stringify(params)
	);
};
api.getOpenId = (params) => {
	return request.globalRequest(
		url.getOpenId,
		"GET",
		params
		// qs.stringify(params)
	);
};
api.checkUser = (params) => {
	return request.globalRequest(
		url.checkUser,
		"GET",
		params
		// qs.stringify(params)
	);
};
api.addUser = (params) => {
	return request.globalRequest(
		url.addUser,
		"POST",
		params
		// qs.stringify(params)
	);
};
api.findStuList = (params) => {
	return request.globalRequest(
		url.findStuList,
		"GET",
		params
		// qs.stringify(params)
	);
};
api.addStudent = (params) => {
	return request.globalRequest(
		url.addStudent,
		"POST",
		params
		// qs.stringify(params)
	);
};
api.updateStudent = (params) => {
	return request.globalRequest(
		url.updateStudent,
		"POST",
		params
		// qs.stringify(params)
	);
};

api.smsCode = (params) => {
	return request.globalRequest(
		url.smsCode,
		"POST",
		params
	);
};

api.login = (params) => {
	return request.globalRequest(
		url.login,
		"POST",
		params
	);
};
export default api;
